package com.example.controller;


import com.example.common.result.Result;
import com.example.entity.dto.inspect.MocLogListDto;
import com.example.entity.yifei.Moclog;
import com.example.mapper.MoclogMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 工单状态日志表 前端控制器
 * </p>
 *
 * @author Lan
 * @since 2024-09-29
 */
@RestController
@RequestMapping("/api/moclog")
public class MoclogController {

    @Autowired
    private MoclogMapper mapper;

    @ApiOperation("排产状态日志")
    @PostMapping("mocLogList")
    public Result<PageInfo<List<Moclog>>> mocLogList(@RequestBody MocLogListDto dto) {
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        List<Moclog> list = mapper.mocLogList(dto);
        PageInfo<List<Moclog>> pageInfo = new PageInfo(list);
        return Result.success(pageInfo);
    }

}
